package com.xsth.controller;

/**
 * 测试控制层
 */
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xsth.model.Student;
import com.xsth.service.Test2Service;
import com.xsth.service.TestService;

@Controller
public class TestController {
	private Logger log = Logger.getLogger(TestController.class);// 记录错误日志
	@Autowired
	private TestService testServiceImpl;
	@Autowired
	private Test2Service test2ServiceImpl;

	@RequestMapping(value = "/test", method = RequestMethod.GET)
	@ResponseBody
	public List<Student> test() {
		log.info("start.......");
		return testServiceImpl.getAll();
	}

	@RequestMapping(value = "/test2", method = RequestMethod.GET)
	@ResponseBody
	public List<Student> test2() {
		log.info("start.......");
		return test2ServiceImpl.getAll();
	}
}
